﻿using System;

namespace Lapointe.WebPartPageHistory.ListEventReceivers
{
    internal enum HistoryMethod
    {
        OTB, Custom
    }

    internal class HistoryFactory
    {
        /// <summary>
        /// Gets the history object.
        /// </summary>
        /// <param name="method">The method.</param>
        /// <returns></returns>
        public static IHistory GetHistoryObject(HistoryMethod method)
        {
            if (method == HistoryMethod.OTB)
            {
                return new OtbHistory();
            }
            if (method == HistoryMethod.Custom)
            {
                throw new NotSupportedException("The Custom method is not presently supported.");
            }
            return null;
        }
    }
}
